package guzb.cnblogs.classloader.third;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * 第三方接口样例-1
 *
 * @author 顾志兵
 * @mail ipiger@163.com
 * @since 2024-05-18
 */
public class SampleApi {

    /**
     * 检查设备信息
     * @param deviceNo 设备编号
     */
    public SampleDevice checkDevice(String deviceNo) {
        SampleDevice device = new SampleDevice();
        device.setSid("GUWD5320P001");
        device.setManager("张三");
        device.setStatus(DeviceStatus.RENT_OUT);

        InterfaceConfiguration interfaceConfig = new InterfaceConfiguration();
        interfaceConfig.setPowerPortCount(2);
        interfaceConfig.setMainWaveformPortCount(2);
        interfaceConfig.setMonitorPortCount(8);
        device.setInterfaceConfig(interfaceConfig);

        LocalDateTime localDateTime = LocalDateTime.of(2019, 3, 3, 15, 32, 28);
        device.setInboundDate(Date.from(localDateTime.atZone(ZoneId.of("Asia/Shanghai")).toInstant()));

        return  device;
    }

}
